Martin Buck delivers "track" upload for Garmin fitness devices.
Changes:
* If tracks and waypoints should be uploaded to a device supporting course
upload, combine them to courses and course points and upload them together
* Split track/waypoint preparation and upload into separate functions in
garmin.c since both preparation functions are needed together for
course+course point upload
* Merged GPS_A301_Get()/GPS_A302_Get, GPS_A301_Send()/GPS_A302_Send()
* Properly handle track segment markers for fitness devices consisting of 2
consecutive invalid track points
* Calculate lap data totals when creating a course. Also create time stamps
(currently using a hardcoded speed of 10km/h) for track points that lack
them. This is required so that course points can refer to track points and
identify them uniquely.
* Fixed course garbage collection to remove unused track points properly. So
far, we compared the track index with the course index instead of the
course track index which inadvertently removed tracks that were
refereneced and left others that weren't referenced.
* Remove duplicate course points (same course index and track point time
stamp) because the protocol spec requires these two values to be unique.
* Create course points from waypoints by mapping them to the nearest track
point.
* Use xrealloc() consistently